<?php


namespace App\Transformers;


use League\Fractal\TransformerAbstract;

class Promoter extends TransformerAbstract
{
    public function transform($data)
    {
        return [
             'id'=>$data->id ,
             'avatar' =>$data->avatar ?? '',
             'nickname' =>$data->nickname ?? '',
             'real_name' =>$data->real_name ?? '',
             'phone' =>$data->phone ?? '',
             'promoter_id' =>$data->promoter_id ?? '',
             'spread_count' =>$data->spread_count ?? '',
             'brokerage_price' =>$data->status ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
